<template>
  <div class="time-line-block">
    <h4>{{year}}</h4>
    <div class="directions">
      <time-line-direction v-for="direction in directions" :key="direction.directionId">{{direction.name}}</time-line-direction>
    </div>
  </div>
</template>

<script>
import TimeLineDirection from '@/components/Pieces/Direction/TimeLineDirection.vue';
export default {
  name: "TimeLineBlock",
  props: {
    data: Object
  },
  computed: {
    year() {
      return this.data.year ?? 0;
    },
    directions() {
      return this.data.directions ?? [];
    }
  },
  components: {
    TimeLineDirection
  },
};
</script>

<style scoped lang="scss">
.time-line-block {
  padding: 6px 10px;
  position: relative;
  >h4 {
    color: rgb(100, 91, 93);
    margin-bottom: 10px;
  }

  >.directions {
    display: flex;
    flex-wrap: wrap;
    margin-left: 20px;
    >* {
      margin-right: 8px;
      margin-bottom: 5px;
    }
  }

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;

  }

}
</style>
